#pragma once

#include "common.hpp"

typedef rt_err_t (*irq_t)(rt_device_t dev, rt_size_t size);

class robot_devuart:public robot_driver
{
public:
    robot_devuart(const char* name, uint32_t boud);
    virtual ~robot_devuart(){};
    void open();

    friend rt_err_t rx_call(rt_device_t dev, rt_size_t size);

protected:
    struct rt_semaphore irq_rx_sem;

private:
    void config_uart();
    uint32_t boudHz;
};


